EXTRA_CFLAGS += -I$(obj) 
obj-m += ndmphba.o
ndmphba-objs := ndmp_hba.o ndmp_user_if.o ndmp_procs.o ndmp_xdr.o ndmp_thread.o ndmp_watchdog.o ndmp_session.o ndmp_module.o ndmp_sysfs.o

all:	modules

modules:
	make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
	make -C $(PWD)/user
	cp -f ndmphba.ko $(PWD)/out
	cp -f $(PWD)/user/ndmphbactl $(PWD)/out
	cp -f readme.txt $(PWD)/out

	@echo
	@echo
	@echo "build complete			Output file"
	@echo "------------------------------------------------------"
	@echo "kernel module :    		$(PWD)/out/ndmphba.ko"
	@echo "User control application:	$(PWD)/out/ndmphbactl"
	@echo "Readme:				$(PWD)/out/readme.txt"
	@echo
	@echo "Read the readme.txt in out directory for information on usage and modules"
	@echo

clean:
	make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
	make -C $(PWD)/user clean
